function [D X] = ResultsEP(output, subjectNrs, electrode, period)
X = []; D = [];
% skipnext = true;
smoothCount = 0;
for i=subjectNrs
    disp(['Subject: ' output.subjects(i).Name]);
    %     if skipnext; continue; end;
    
    if length(output.results(i).period)<period
        Xep = []; Dep = [];
        disp('     - Period unavailable...');
    else
        [Dep Xep] = ResultsSEP(output, i, electrode, period); % Data per subject is already normalized
        smoothCount = smoothCount + 1;
    end
    D = [D Dep];
    X = [X Xep];
end
[sy si] = sort(X);
D = D(:,si);
X = X(si);

window = 30*smoothCount;
if window > length(X)
    window = length(X);
end
disp('    Smoothing');
for d=1:8
    D(d,:) = fastsmooth(D(d,:), window, 3, 1);
end
end